package com.ayx.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyselfRule {
    //选择ribbon自带的负载均衡策略
    @Bean
    public IRule getIRule(){
        return  new RandomRule(); //定义为随机
    }
}